package com.example.index.web.feign;

import com.example.index.web.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

//不带降级配置
//@FeignClient("user")
//带降级配置,设置降级类
@FeignClient(value = "user",fallback = UserActionHystrix.class)
public interface IUserAction {

    @RequestMapping("user")
    public String user();

    @RequestMapping("hello")
    String hello(@RequestParam("name") String name);

    @RequestMapping("add")
    int add(@RequestParam("a")int a,@RequestParam("b") int b);

    @RequestMapping("reg")
    public User reg(@RequestBody User user);

    @RequestMapping("path/{ptest}")
    public String ptest(@PathVariable("ptest") String ptest);
}


